<?php
  
  $sql="SELECT * FROM content WHERE menu_active = 1 AND _usergroup<=".config::$userData['usergroup_number']."
            AND ((item_parent_id = '".config::$contentData['content_id']."') OR 
             (item_parent_id <> '".config::$contentData['content_id']."' AND      
             item_parent_id = '".config::$contentData['item_parent_id']."') AND level=3) ORDER BY item_order";    
  
  echo $sql;
  
  foreach (db::getQuery($sql) as $externalSubSubmenu) {
  
?>
